//导入request.js请求工具
import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js';


export const login = (categoryData)=>{
    return request.post('/login/login?currentPage='+categoryData.currentPage,categoryData)
}

export const register = (categoryData)=>{
    return request.post('/login/register?currentPage='+categoryData.currentPage,categoryData)
}

export const finduser = (categoryData)=>{
    return request.post('/admin/finduser?currentPage='+categoryData.currentPage,categoryData)
}

export const updateuser = (categoryData)=>{
    return request.post('/admin/updateuser',categoryData)
}

export const deluser = (categoryData)=>{
    return request.post('/admin/deluser',categoryData)
}

export const adduser = (categoryData)=>{
    return request.post('/admin/adduser',categoryData)
}

export const findtearchlist = (categoryData)=>{
    return request.post('/admin/findtearchlist',categoryData)
}
export const findCourse = (categoryData)=>{
    return request.post('/admin/findCourse?currentPage='+categoryData.currentPage,categoryData)
}

export const updateCourse = (categoryData)=>{
    return request.post('/admin/updateCourse?currentPage='+categoryData.currentPage,categoryData)
}

export const addCourse = (categoryData)=>{
    return request.post('/admin/addCourse?currentPage='+categoryData.currentPage,categoryData)
}

export const delCourse = (categoryData)=>{
    return request.post('/admin/delCourse?currentPage='+categoryData.currentPage,categoryData)
}

export const findCommunity = (categoryData)=>{
    return request.post('/admin/findCommunity?currentPage='+categoryData.currentPage,categoryData)
}

export const updateCommunity = (categoryData)=>{
    return request.post('/admin/updateCommunity?currentPage='+categoryData.currentPage,categoryData)
}

export const delCommunity = (categoryData)=>{
    return request.post('/admin/delCommunity?currentPage='+categoryData.currentPage,categoryData)
}

export const addCommunity = (categoryData)=>{
    return request.post('/admin/addCommunity?currentPage='+categoryData.currentPage,categoryData)
}

export const findProduct = (categoryData)=>{
    return request.post('/admin/findProduct?currentPage='+categoryData.currentPage,categoryData)
}

export const updateProduct = (categoryData)=>{
    return request.post('/admin/updateProduct?currentPage='+categoryData.currentPage,categoryData)
}

export const addProduct = (categoryData)=>{
    return request.post('/admin/addProduct?currentPage='+categoryData.currentPage,categoryData)
}

export const delProduct = (categoryData)=>{
    return request.post('/admin/delProduct?currentPage='+categoryData.currentPage,categoryData)
}

export const findReview = (categoryData)=>{
    return request.post('/admin/findReview?currentPage='+categoryData.currentPage,categoryData)
}

export const addReview = (categoryData)=>{
    return request.post('/admin/addReview?currentPage='+categoryData.currentPage,categoryData)
}

export const delReview = (categoryData)=>{
    return request.post('/admin/delReview?currentPage='+categoryData.currentPage,categoryData)
}


export const findStudent = (categoryData)=>{
    return request.post('/admin/findStudent?currentPage='+categoryData.currentPage,categoryData)
}

export const updateStudent = (categoryData)=>{
    return request.post('/admin/updateStudent?currentPage='+categoryData.currentPage,categoryData)
}

export const delStudent = (categoryData)=>{
    return request.post('/admin/delStudent?currentPage='+categoryData.currentPage,categoryData)
}

export const findGrowthRecord = (categoryData)=>{
    return request.post('/admin/findGrowthRecord?currentPage='+categoryData.currentPage,categoryData)
}

export const updateGrowthRecord = (categoryData)=>{
    return request.post('/admin/updateGrowthRecord?currentPage='+categoryData.currentPage,categoryData)
}

export const addGrowthRecord = (categoryData)=>{
    return request.post('/admin/addGrowthRecord?currentPage='+categoryData.currentPage,categoryData)
}

export const delGrowthRecord = (categoryData)=>{
    return request.post('/admin/delGrowthRecord?currentPage='+categoryData.currentPage,categoryData)
}

export const findstudentlist = (categoryData)=>{
    return request.post('/admin/findstudentlist?currentPage='+categoryData.currentPage,categoryData)
}



export const finUserData = (categoryData)=>{
    const tokenStore = useTokenStore();
    console.log(tokenStore.token);
    tokenStore.token;
    return request.post('/admin/finUserData',{headers:{'Authorization':tokenStore.token}})
}





